package com.ccys.cms.service.userManagement.impl;


import com.ccys.cms.service.userManagement.TblMemberFamilyWebService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.userManagement.TblMemberFamilyDTO;
import com.ccys.db.entity.TblMemberFamily;
import com.ccys.db.mapper.TblMemberFamilyMapper;
import com.ccys.db.page.PageUtils;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.userManagement.TblMemberFamilyWebVO;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


/**
 * tbl_member_family管理
 */
@Service
@Slf4j
public class TblMemberFamilyWebServiceImpl extends BaseServiceImpl<TblMemberFamily> implements TblMemberFamilyWebService {

    @Autowired(required = false)
    private TblMemberFamilyMapper tblMemberFamilyMapper;

    @Override
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, TblMemberFamilyDTO dto) {
        PageUtils.startPage(request);
        List<TblMemberFamilyWebVO> list = this.tblMemberFamilyMapper.listObjectsCms(dto);
        PageInfo pageInfo = new PageInfo<>(list);
        return ResponseResult.success(pageInfo);
    }




    @Override
    public ResponseResult delete(TblMemberFamily dto) {
        TblMemberFamily entity = new TblMemberFamily();
        entity.setId(dto.getId());
        entity.setDelFlag(1);
        this.updateEntityById(entity);
        return ResponseResult.success();
    }


}